// Test2.cpp : Defines the entry point for the console application.
//

#include "base64.h"  
#include "stdafx.h"
#include "pbc.h"
#include "pbc_test.h"
#include <string.h>
#include <iostream>
using namespace std;

#define Length 128

int main(int argc, char **argv)
{
	element_t RID;
	pairing_t pairing;
	
	pbc_demo_pairing_init(pairing, 2, argv); 
	element_init_G1(RID, pairing);
	
	string RID_s = argv[2];
	unsigned char *RID_rev = (unsigned char *)RID_s.c_str();
	element_from_hash(RID, RID_rev, strlen((char *)RID_rev));
	unsigned char RID_byte[Length];
	int RID_length = element_to_bytes(RID_byte, RID);
	string RID_base64 = base64_encode(RID_byte, RID_length);
	cout << RID_base64;
	return 0;
}